package com.koko.feign;

import com.koko.config.FeignClientConfig;
import com.koko.game.dto.GamePageQueryDTO;
import com.koko.game.dto.PublisherPageQueryDTO;
import com.koko.game.entity.Game;
import com.koko.game.entity.Publisher;
import com.koko.game.vo.GameAdminPageItemVO;
import com.koko.result.PageResult;
import com.koko.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "game-service", url = "http://localhost:8080", configuration = FeignClientConfig.class)
public interface GameFeignService {

    @GetMapping("/game/fromnews/publisher/page")
    PageResult<Publisher> getPublisherList(
            @RequestParam("page") Integer page,
            @RequestParam("pageSize") Integer pageSize,
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "sort", required = false) Integer sort
    );

    @GetMapping("/game/formnews/page")
    PageResult<Game> getGameList(
            @RequestParam("page") Integer page,
            @RequestParam("pageSize") Integer pageSize,
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "sort", required = false) Integer sort
    );

    @GetMapping("/game/fromnews/publisher/{id}")
    Result<Publisher> getPublisherById(@PathVariable Long id);

    @GetMapping("/game/fromnews/{id}")
    Result<Game> getGameById(@PathVariable Long id);
}
